using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//面板脚本在场景中肯定只会挂载一次, 设计为单例
public class BasePanel<T> : MonoBehaviour where T:class
{
    private static T instance;
    public static T Instance => instance;
    private void Awake()
    {
        //记录场景上唯一的这个脚本
        instance = this as T;
    }

    public virtual void ShowPanel()
    {
        gameObject.SetActive(true);
    }
    public virtual void HidePanel()
    {
        gameObject.SetActive(false);
    }
}
